package cn.design.realize;

/**
 * @author dlq
 * @description 计算机产品: 它由 cpu , 硬盘(hardDisk), 内存(memory)等多个零件组成(这里只写这三个)
 * 产品属性： cpu, 硬盘(hardDisk), 内存(memory)
 * @date 2020/9/15 9:49
 * @since 1.0
 */
public class ComputerProduct {

    /**
     * cpu
     */
    private String cpu;

    /**
     * 硬盘
     */
    private String hardDisk;
    /**
     * 内存
     */
    private String memory;

    public String getCpu() {
        return cpu;
    }

    public void setCpu(String cpu) {
        this.cpu = cpu;
    }

    public String getHardDisk() {
        return hardDisk;
    }

    public void setHardDisk(String hardDisk) {
        this.hardDisk = hardDisk;
    }

    public String getMemory() {
        return memory;
    }

    public void setMemory(String memory) {
        this.memory = memory;
    }

    @Override
    public String toString() {
        return "ComputerProduct{" +
                "cpu='" + cpu + '\'' +
                ", hardDisk='" + hardDisk + '\'' +
                ", memory='" + memory + '\'' +
                '}';
    }

    /**
     * @param
     * @return void
     * @description 打印计算机产品的信息
     * @author dlq
     * @date 2020/9/15 9:54
     */
    public void print() {
        System.out.printf("cpu信息: %s , 硬盘信息: %s , 内存: %s\n ",cpu,hardDisk,memory);
    }
}
